﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using NUnit.Framework;
using Agility.ViewModels;

namespace Agility.Testing.Silverlight.ViewModels
{
    [TestFixture]
    public class RegistrationCompletedEventArgsTests
    {
        #region optional setup and teardown
        //[TestFixtureSetUp]
        //public void SetupFixture()
        //{
        //}

        //[TestFixtureTearDown]
        //public void TearDownFixture()
        //{
        //}

        //[SetUp]
        //public void SetupTest()
        //{
        //}

        //[TearDown]
        //public void TeardownTest()
        //{
        //}
        #endregion

        [Test]
        public void RegistrationCompletedEventArgsConstructorTest()
        {
            // Arrange
            RegistrationCompletedEventArgs target;
            string expectedErrorMessage = "Some error text.";
            string expectedExceptionMessage = "Some Exception error message.";
            InvalidOperationException expectedError = new InvalidOperationException(expectedExceptionMessage);

            // Act
            target = new RegistrationCompletedEventArgs(true, true, expectedErrorMessage, expectedError);

            // Assert
            Assert.IsTrue(target.HasValidationErrors);
            Assert.IsTrue(target.LoggedIn);
            Assert.AreEqual(expectedErrorMessage, target.ErrorMessage);
            Assert.IsInstanceOf(typeof(InvalidOperationException), target.Error);
            Assert.AreEqual(expectedExceptionMessage, target.Error.Message);
        }
    }
}
